package com.gqz.patrol.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gqz.common.core.domain.R;
import com.gqz.common.core.domain.RequestForm;
import com.gqz.patrol.vo.*;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 能源-巡视工单表
 */


//@RequestMapping("/en-patrol-task")
@FeignClient(name = "bs-patrol", contextId = "en-patrol-task", path = "/en-patrol-task")
public interface EnPatrolTaskApi {
    @PostMapping("/{id}")
    public R<List<EnPatrolTaskVo>> getById(
            @PathVariable("id") String id);

    @PostMapping("/getByTaskNo/{taskNo}")
    public R<List<EnPatrolTaskVo>> getByTaskNo(
            @PathVariable("taskNo") String taskNo);

    @PostMapping("/page")
    public R<Page<EnPatrolTaskVo>> page(
            @RequestBody RequestForm<EnPatrolTaskVo> requestForm);

    @PostMapping("/count")
    public R<Long> count(
            @RequestBody RequestForm<EnPatrolTaskVo> requestForm);

    @PostMapping("/insert")
    public R<List<String>> insertV2(
            @RequestBody List<EnPatrolTaskVo> forms);

    @PostMapping("/update")
    public R<Integer> update(
            @RequestBody List<EnPatrolTaskVo> forms);

    @PostMapping("/delete")
    public R<Boolean> delete(
            @RequestBody List<String> ids);

    @PostMapping("/sendOrder")
    public R<Integer> sendOrder(
            @RequestBody EnPatrolTaskVo vo);

    @PostMapping("/getTaskEquipList/{taskNo}")
    public R<List<EnPatrolTaskEquipVo>> getTaskEquipList(
            @PathVariable("taskNo") String taskNo);

    @PostMapping("/getTaskDefectList/{taskNo}")
    public R<List<EnStockEquipDefectVo>> getTaskDefectList(
            @PathVariable("taskNo") String taskNo);

    @PostMapping("/getTaskProcess/{taskNo}")
    public R<EnPatrolTaskProcessVo> getTaskProcess(
            @PathVariable("taskNo") String taskNo);

    /**
     * 根据任务编号查询已处理缺陷隐患列表
     *
     * @param handleTaskNo 处理任务编号
     * @return {@link R}<{@link List}<{@link EnStockEquipDefectVo}>>
     */
    @PostMapping("/getTaskHandleDefectList/{handleTaskNo}")
    public R<List<EnStockEquipDefectVo>> getTaskHandleDefectList(
            @PathVariable("handleTaskNo") String handleTaskNo);

    @GetMapping("/genTaskNo")
    R<String> genTaskNo();

    @PostMapping("exportExcel")
    void exportExcel(
            @RequestParam("resp")
            HttpServletResponse resp,
            @RequestBody
            RequestForm<EnPatrolTaskExcelVo> requestForm);

    /**
     * 获取坐标
     *
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @param yhid      yhid公司
     * @return {@link R}<{@link List}<{@link EnGisVo}>>
     */
    @PostMapping("/energyPtgis")
    public R<List<EnGisVo>> energyPtgis(
            @RequestParam("startTime") String startTime,
            @RequestParam("endTime") String endTime,
            @RequestParam("yhid") String yhid);

    /**
     * 获取工单统计数量
     *
     * @param sdate 日期
     * @param edate 埃达特
     * @return {@link List}<{@link EnTjVo}>
     */
    @RequestMapping(value = "/getGdStatusXx", method = RequestMethod.GET)
    public List<EnTjVo> getGdStatusXx(
            @RequestParam("sdate") String sdate,
            @RequestParam("edate") String edate);

}
